﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TR.Domain.Entity;
using TR.Domain.Repository.Sys_MessagesRepository;

namespace TR.AppService.AppService.Sys_Messages
{
    public class SystemMessagesAppService : ISystemMessagesAppService
    {
        private readonly ISystemMessagesRepository systemMessagesRepository;
        private readonly IMapper mapper;
        public SystemMessagesAppService(ISystemMessagesRepository systemMessagesRepository, IMapper mapper) 
        {
            this.systemMessagesRepository = systemMessagesRepository;
            this.mapper = mapper;
        }
        //分页查询
        public Task<FenYe<sys_Message>> SysMesFenYe(int pageSize, int currentPage, string str)
        {
            return systemMessagesRepository.SysMessageSelectFenYe(pageSize, currentPage, str);
        }

        //系统消息未读改为已读
        public async Task<bool> UpdateSysMes(int msg_id, string rcv_man)
        {
            return await systemMessagesRepository.UpdateSysMesDel(msg_id, rcv_man);
        }
    }
}
